import tkinter as tk

window = tk.Tk()
window.geometry("300x200")
var = tk.StringVar()
var.set("0123456789abcdefghijklmnopqrstuvwxyz0123456789")
e1 = tk.Entry(window,show = None,font = ('黑体',12),bd=3,width = 15,textvariable = var)
e1.pack()


def b_func():
        e1.scan_mark(0)
        e1.scan_dragto(-2)
#创建一个按钮并放置，点击按钮调用b_func函数
button = tk.Button(window,text = "button",font =('Arial',10),command = b_func)
button.pack()
window.mainloop()
